<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/25
 * Time: 18:52
 */

namespace App\Activities;


class UserUpvotedTransRecord extends BaseActivity
{
    public function generate($user, $record)
    {
        $this->addTopicActivity($user, $record->translateSection->topic, [
            'body' => $record->translate_text,
            'translate_record_id' => $record->id,
            'translator_id' => $record->translator_id,
            'translator_name' => $record->user->name,
        ], "r$record->id");
    }

    public function remove($user, $record)
    {
        $this->removeBy("u$user->id", "r$record->id");
    }
}